package net.htjs.mobile.nyoa.gw;

import net.htjs.mobile.nyoa.R;
import android.app.Activity;
import android.content.SharedPreferences;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.Window;
import android.widget.TextView;

public class ToNotificationActivity extends Activity{

	private TextView textview = null;  
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);  
		requestWindowFeature(Window.FEATURE_NO_TITLE); 
        setContentView(R.layout.notification2);  
       
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);    
              
        textview = (TextView)findViewById(R.id.textview);  
        String notificationsound = sharedPreferences.getString("notification_sounds", null);  
        if(notificationsound == null){  
            textview.setText("默认Notification声音");  
        } else{  
            Ringtone ringtone =  RingtoneManager.getRingtone(ToNotificationActivity.this, Uri.parse(notificationsound));  
            String title = ringtone.getTitle(ToNotificationActivity.this);  
            textview.setText(title);  
        }  
	}
}
